package com.sunni.controller;

import com.sunni.entity.Department;
import com.sunni.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/dept")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("/selectAll")
    @ResponseBody
    public List<Department> selectAll(){
        return departmentService.selectAll();
    }


}
